<template>
  <el-container>
    <el-aside width="200px">
      <el-menu background-color="#001529" text-color="#fff" active-text-color="#409eff" class="common-aside"
        default-active="0">
        <el-menu-item v-for="(item, i) in routerConfig" :key="i+'_index'" :index="i.toString()" @click="clickMenu(item)">
          <i :class="item.icon"></i>
          <span slot="title">{{ item.name }}</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-container>
      <el-main><router-view></router-view></el-main>
    </el-container>
  </el-container>
</template>

<script>
import { router as routerConfig } from './router'
export default {
  name: 'App',
  components: {
  },
  data() {
    return {
      routerConfig: routerConfig
    }
  },
  methods: {
    clickMenu(item) {
      this.$router.push(item.path)
    }
  }
}
</script>

<style scoped>
.common-aside {
  height: 100vh;
}
</style>
